import Vue from 'vue';

Vue.mixin({
  data() {
    return {
      tableHeight: 0,
    };
  },
  mounted() {
    if (this.$refs['cardTable']) {
      this.computedTableHeight();
    }
  },
  methods: {
    //计算列表高度
    computedTableHeight() {
      this.$nextTick(() => {
        let innerHeight = window.innerHeight;
        let top = this.$refs?.cardTable?.$el?.offsetTop ?? 0;
        let pageSize = this.$refs?.pageSize?.$el?.offsetHeight ?? 0;
        this.tableHeight = innerHeight - top - pageSize - 42;
        console.log(top, pageSize, this.tableHeight);
      });
    },
  },
});
